< previous page page_366 next page >

Page 366
Another useful parameter is the CopiesToPrinter property. This property enables you to print multiple copies of your report easily at one time.
Modifying Report Properties
After the Crystal Reports control has been added to the form and you have set its properties, you are ready to start printing, right? Well, not quite. You still have to tell Crystal Reports when to print the report. You do this by setting the Action property of the Crystal Reports control to 1. This tells the control to execute the Crystal Reports processing engine to run the specified report.
Tip
For easy understanding in your code, you should define a constant to use in place of the number one when requesting Crystal Reports to start.

To see how this works, add a command button to the new form and place the following line of code in its Click routine:
crReport.Action = crRunReport  This is a constant for the value 1
Now execute the application and click the Command button to run the report. The report you entered in the Properties page is executed and displayed in its own window, as shown in Figure 13.21.
12181-0366a.gif
Figure 13.21.
Displaying the report on the screen from a
Visual Basic application.
This was just a simple example of displaying a report from an application. There are many more options, properties, and methods that you can use to customize how the report looks when it is displayed, and what data will be retrieved from the database.

 
< previous page page_366 next page >

If you like this book, buy it!